﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class ConsoleApp1
{
    public static void Main(string[] args)
    {
        Console.WriteLine("数组长度：");
        string s=Console.ReadLine();
        int n=Int32.Parse(s);
        int []a = new int[n];
        for(int i=0; i < n; i++)
        {
            Console.WriteLine("数组元素：");
            string num=Console.ReadLine();
            a[i] =int.Parse(num);
        }
        //max
        int max = -1000000;
        for(int i=0; i < n; i++) {
            if (a[i] > max)
            {
                max = a[i];
            }
        }
        Console.WriteLine("最大值为"+max);
        //min
        int min = 1000000;
        for(int i=0; i < n;i++) {
            if (a[i] < min)
            {
                min= a[i];
            }
        }
        Console.WriteLine("最小值为"+min);
        //sum
        int sum = 0;
        for(int i=0; i < n; i++)
        {
            sum += a[i];
        }
        Console.WriteLine("总和是" + sum);
        //average
        int average = sum / n;
        Console.WriteLine("平均值是"+average);
    }
}
